﻿using QFramework;

namespace HKTools
{
    /// <summary>
    /// 设置 TargetCam 目标切换的时间
    /// </summary>
    public class CMD_SetTargetChangeTime : AbstractCommand
    {
        float targetChangeTime;

        public CMD_SetTargetChangeTime(float targetChangeTime)
        {
            this.targetChangeTime = targetChangeTime;
        }

        protected override void OnExecute()
        {
            if (targetChangeTime <= 0)
            {
                targetChangeTime = 0.1f;
            }

            if (targetChangeTime > 5)
            {
                targetChangeTime = 5;
            }

            this.GetSystem<IHK_TargetCamSystem>().SetTargetChangeTime(targetChangeTime);
        }
    }
}
